﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace lopet.data
{
    public delegate void CellChangedEventDelegate();
    public class Cell
    {
        public Point Center { get; set; }
        public double Radius { get; set; }
        public int NumberOfAbsorbedMolecules { get; set; }        
        
        public Cell(Point center, double radius)
        {
            NumberOfAbsorbedMolecules = 0;
            Center = center;
            Radius = radius;
        }

        public void AbsorbMolecule() 
        {
            NumberOfAbsorbedMolecules++;
        }

        public bool IsMoleculeInside(Molecule molecule)
        {
            return (molecule.Point.DistanceTo(Center) <= Radius);
        }
    }
}
